/* Layout */
import Layout from '@/views/platform/Layout'

import Login from '@/views/login'
/**
 * 静态路由，不需要授权
 */
export const constantRoutes = [
  {
    path: '/redirect',
    component: Layout,
    hidden: true,
    children: [
      {
        path: '/redirect/:path*',
        component: () => import('@/views/redirect/index')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    meta: { title: '用户登录' },
    component: Login,
    hidden: true
  },
  {
    path: '/',
    name: 'home',
    component: Layout
    // redirect: 'dashboard'
    // children: [
    //   {
    //     path: 'dashboard',
    //     component: () => import('@/views/dashboard/index'),
    //     name: 'Dashboard',
    //     meta: { title: 'dashboard', icon: 'dashboard', noCache: true }
    //   }
    // ]
  }
]
/**
 * 动态路由，可配置授权
 */
export const asyncRoutes = [
  {
    path: '/resource',
    component: Layout,
    children: [{
      path: 'manager',
      component: () => import('@/views/resource/manager'),
      name: 'manager',
      meta: { title: '资源管理', icon: 'dashboard', noCache: true }
    }]
  },
  {
    path: '/role',
    component: Layout,
    children: [{
      path: 'manager',
      component: () => import('@/views/role/manager'),
      name: 'manager',
      meta: { title: '资源管理', icon: 'dashboard', noCache: true }
    }]
  },
  {
    path: '/user',
    component: Layout,
    children: [{
      path: 'manager',
      component: () => import('@/views/user/manager'),
      name: 'manager',
      meta: { title: '资源管理', icon: 'dashboard', noCache: true }
    }]
  },
  {
    path: '/organization',
    component: Layout,
    children: [{
      path: 'manager',
      component: () => import('@/views/organization/manager'),
      name: 'manager',
      meta: { title: '资源管理', icon: 'dashboard', noCache: true }
    }]
  },
  {
    path: '/article',
    component: Layout,
    children: [{
      path: 'create',
      component: () => import('@/views/article/index'),
      name: 'manager',
      meta: { title: '文章管理', icon: 'dashboard', noCache: true }
    }]
  }
]
